package com.green.web.util;

import java.util.Random;

public final class ColorUtil {

	static String[] colors = new String[] { "9cb5c9","865a86" ,"c3a036", "cb865a",
			"2e8585"  };

	static Random random = new Random();

	public static String getColor(int i) {
		if (i < colors.length) {
			return colors[i];
		}

		int r = random.nextInt(2<<20);

		StringBuffer buf = new StringBuffer();
		buf.append(r);
		if (((int) r & 0xff) < 0x10) {
			buf.append("0");
		}
		buf.append(Long.toString((int) r & 0xff, 16));
		return buf.toString();

	}
}
